package com.goldgov.mobile;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.goldgov.utils.MobileStaticData;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/** 
 * @ClassName: OrgWorkForMobileController 
 * @Description: TODO
 * @author hanxiangyu
 * @date 2018年6月27日 下午3:59:45 
 */
@RestController
@RequestMapping("/mobile/orgwork")
@Api("组织工作移动接口")
public class OrgWorkForMobileController {
	
	@GetMapping
	@ApiOperation(value = "组织工作列表", notes ="组织工作列表")
	public String getOrgWorkList(HttpServletRequest request,Model model) throws Exception{
		String url = "http://rap2api.taobao.org/app/mock/13521/model/list";
		Map<String, String> map = new HashMap<>();
		map.put("id", "8574998224739896");
		return MobileStaticData.getStaticData(url, map);
	}
	@GetMapping("/getOrgWorkById")
	@ApiOperation(value = "组织工作详情", notes ="组织工作详情")
	public String getOrgWorkById(@ApiParam(value="id",required=false) @PathVariable("id") String id,HttpServletRequest request,Model model) throws Exception{
		String url = "http://rap2api.taobao.org/app/mock/13521/model/detail";
		Map<String, String> map = new HashMap<>();
		if (id != null || !"".equals(id)) {
			map.put("id", id);
		}else {
			map.put("id", "8317091755797564");
		}
		return MobileStaticData.getStaticData(url, map);
	}
	
	
	
}
